@file:Suppress("NOTHING_TO_INLINE")

package com.windea.breezeframework.javafx.extensions

//inline fun <T : Number> Int.cal(block: (Int) -> T): Int = block(this).toInt()
//
//inline fun <T : Number> Long.cal(block: (Long) -> T): Long = block(this).toLong()
//
//inline fun <T : Number> Float.cal(block: (Float) -> T): Float = block(this).toFloat()
//
//inline fun <T : Number> Double.cal(block: (Double) -> T): Double = block(this).toDouble()


inline infix fun Int.exactTimes(other: Int): Int = this.times(other)

inline infix fun Int.exactTimes(other: Long): Int = this.times(other).toInt()

inline infix fun Int.exactTimes(other: Float): Int = this.times(other).toInt()

inline infix fun Int.exactTimes(other: Double): Int = this.times(other).toInt()

inline infix fun Long.exactTimes(other: Int): Long = this.times(other)

inline infix fun Long.exactTimes(other: Long): Long = this.times(other)

inline infix fun Long.exactTimes(other: Float): Long = this.times(other).toLong()

inline infix fun Long.exactTimes(other: Double): Long = this.times(other).toLong()


inline infix fun Int.exactDiv(other: Int): Int = this.div(other)

inline infix fun Int.exactDiv(other: Long): Int = this.div(other).toInt()

inline infix fun Int.exactDiv(other: Float): Int = this.div(other).toInt()

inline infix fun Int.exactDiv(other: Double): Int = this.div(other).toInt()

inline infix fun Long.exactDiv(other: Int): Long = this.div(other)

inline infix fun Long.exactDiv(other: Long): Long = this.div(other)

inline infix fun Long.exactDiv(other: Float): Long = this.div(other).toLong()

inline infix fun Long.exactDiv(other: Double): Long = this.div(other).toLong()
